package com.example.demo.dao;

import com.example.demo.entity.SysOrderStepLog;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface SysOrderStepLogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order_step_log
     *
     * @mbg.generated
     */
    @Delete({
        "delete from sys_order_step_log",
        "where order_id = #{orderId,jdbcType=INTEGER}",
          "and order_step = #{orderStep,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(@Param("orderId") Integer orderId, @Param("orderStep") Integer orderStep);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order_step_log
     *
     * @mbg.generated
     */
    @Insert({
        "insert into sys_order_step_log (order_id, order_step, ",
        "user_id, create_date)",
        "values (#{orderId,jdbcType=INTEGER}, #{orderStep,jdbcType=INTEGER}, ",
        "#{userId,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP})"
    })
    int insert(SysOrderStepLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order_step_log
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "order_id, order_step, user_id, create_date",
        "from sys_order_step_log",
        "where order_id = #{orderId,jdbcType=INTEGER}",
          "and order_step = #{orderStep,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_step", property="orderStep", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP)
    })
    SysOrderStepLog selectByPrimaryKey(@Param("orderId") Integer orderId, @Param("orderStep") Integer orderStep);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order_step_log
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "order_id, order_step, user_id, create_date",
        "from sys_order_step_log"
    })
    @Results({
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="order_step", property="orderStep", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<SysOrderStepLog> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_order_step_log
     *
     * @mbg.generated
     */
    @Update({
        "update sys_order_step_log",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "create_date = #{createDate,jdbcType=TIMESTAMP}",
        "where order_id = #{orderId,jdbcType=INTEGER}",
          "and order_step = #{orderStep,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(SysOrderStepLog record);
}